<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <div>
        <a href="./dom改变html.html">改变html</a>
        <p>我要放假</p>
    </div>
    <div>
        <ul id="ul">
            <li class="li1">
                <p id="p" title="pppp">html</p>
            </li>
            <li class="li2">css</li>
            <li class="li3">js</li>
        </ul>
    </div>
    <script>
        var ulEl = document.querySelector('#ul');
        console.log(ulEl.firstElementChild);
        var liEl = document.querySelector('.li2');
        console.log(liEl.nextElementSibling);
        console.log(liEl.previousElementSibling);
        // 节点信息
        console.log(ulEl.nodeName, ulEl.nodeValue, ulEl.nodeType);
        console.log(p.nodeName, p.nodeValue, p.nodeType);
        console.log(liEl.nodeName, liEl.nodeValue, liEl.nodeType);
        // ======== 找个节点 ======
        console.log(ulEl.firstChild.nodeName, ulEl.firstChild.nodeValue, ulEl.firstChild.nodeType);
        </script>
</body>
</html>